package com.suep.system.config;


import lombok.Data;

@Data
public class BaseR<T> {


    private Integer code;
    private String message;
    private T data;

    public BaseR(){}

    public BaseR(int code, String message, T data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public BaseR(Integer code, String message) {
        this.code = code;
        this.message = message;
        this.data = null;
    }

    public BaseR ok(String message,T data){
       return new BaseR(200,message,data);
    }
    public BaseR error(String message,T data){
        return new BaseR(500,message,data);
    }
    public BaseR error(String message){
        return new BaseR(500,message,null);
    }
    public BaseR ok(String message){
        return new BaseR(200,message,null);
    }
    public BaseR forbidden(String message){
        return new BaseR(403,message,null);
    }

}
